package com.butte.mound.frame.exception;

import com.butte.mound.frame.entity.Resp;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class BizExe extends RuntimeException {

    private int code ;

    private String msg ;

    public BizExe(Resp baseResp) {
        super(baseResp.getMsg());
        this.code = baseResp.getCode() ;
        this.msg = baseResp.getMsg() ;
    }

    public BizExe(ErrorEnum error){
        super(error.getMsg());
        this.code = error.getCode();
        this.msg = error.getMsg();
    }

}